﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Babel.ParserGenerator;

namespace dragonangel.phpProject.Language.DSL
{
    public enum AssignationOperator
    {
        Equal,
        Concat,
        UnitIncrement,
        UnitDecrement,
        Increment,
        Decrement
    }

    public class CodeAssignStatement : CodeStatement
    {
        public CodeAssignStatement(CodeExpression left, CodeExpression right, AssignationOperator op, LexLocation begin, LexLocation end)
            : base(begin, end)
        {
            this.left = left;
            this.right = right;
            this.op = op;
        }

        public CodeAssignStatement(CodeExpression left, CodeExpression right, LexLocation begin, LexLocation end)
            : this(left, right, AssignationOperator.Equal, begin, end)
        {
        }

        public CodeAssignStatement(CodeExpression value, AssignationOperator op, LexLocation begin, LexLocation end)
            : this(value, null, op, begin, end)
        {
        }

        protected CodeExpression left;
        public CodeExpression Left
        {
            get { return left; }
            set { left = value; }
        }

        protected CodeExpression right;
        public CodeExpression Right
        {
            get { return right; }
            set { right = value; }
        }

        protected AssignationOperator op;
        public AssignationOperator Operator
        {
            get { return op; }
            set { op = value; }
        }
    }
}
